//
//  SQAcceptance_of_hidden_danger_rectificationModel.m
//  energy
//
//  Created by 周曼迪 on 2021/7/14.
//

#import "SQAcceptance_of_hidden_danger_rectificationModel.h"

@implementation SQAcceptance_of_hidden_danger_rectificationModelRectification

@end

@implementation SQAcceptance_of_hidden_danger_rectificationModelAcceptor

@end


@implementation SQAcceptance_of_hidden_danger_rectificationModel
+(NSString *)api{
    return @"hidden_danger_report/hidden_danger.asmx/acceptance_of_hidden_danger_rectification";
}
+(NSDictionary *)cc_arrayWithClass{
    return @{@"acceptor":[SQAcceptance_of_hidden_danger_rectificationModelAcceptor class],
             @"rectification":[SQAcceptance_of_hidden_danger_rectificationModelRectification class]
    };
}

- (NSArray<NSString *> *)rectificationArr{
    NSMutableArray *arr = @[].mutableCopy;
    for (SQAcceptance_of_hidden_danger_rectificationModelRectification *d in self.rectification) {
        
        [arr addObject:[self join:@[[self isEmptyNull:d.m_two_text],[self isEmptyNull:d.m_three_text],[self isEmptyNull:d.m_four_text],[self isEmptyNull:d.m_name]]]];
    }
    return arr;
}


- (NSArray<NSString *> *)acceptorArr{
    NSMutableArray *arr = @[].mutableCopy;
    for (SQAcceptance_of_hidden_danger_rectificationModelAcceptor *d in self.acceptor) {

        [arr addObject:[self join:@[[self isEmptyNull:d.m_two_text],[self isEmptyNull:d.m_three_text],[self isEmptyNull:d.m_four_text],[self isEmptyNull:d.m_name]]]];
    }
    return arr;
}

- (NSString *)join:(NSArray<NSString *> *)strs{
    NSString *str = @"";
    
    for (NSString *key in strs) {
        if (key.length > 0) {
            str = [str stringByAppendingFormat:@"%@/",key];
        }
    }
    if (!str.length)return @"";
    return [str substringToIndex:str.length - 1];
}

- (NSString *)isEmptyNull:(NSString *)string{
    if (string == nil || string == NULL) {
        string = @"";
    }
    return string;
}

@end
